home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ada
/
ada_lrm1.zip
/
CHAPA.DOC
next >
Wrap
Text File
|
1988-11-30
|
27KB
|
992 lines
The following document is a draft of the corresponding chapter of the
version of the Ada Reference Manual produced in response to the Ansi
Canvass. It is given a limited circulation to Ada implementers and to
other groups contributing comments (according to the conventions defined in
RRM.comments). This draft should not be referred to in any publication.
ANSI-RM-A-v23 - Draft Chapter
A Predefined Language Attributes
version 23
83-02-11
This revision has considered all comments up to #5795
A. Predefined Language Attributes
This annex summarizes the definitions given elsewhere of the predefined
language attributes.
P'ADDRESS For a prefix P that denotes an object, a program unit, a
label, or an entry:
Yields the address of the first of the storage units
allocated to P. For a subprogram, package, task unit, or
label, this value refers to the machine code associated
with the corresponding body or statement. For an entry
for which an address clause has been given, the value
refers to the corresponding hardware interrupt. The
value of this attribute is of the type ADDRESS defined in
the package SYSTEM. (See 13.7.2.)
P'AFT For a prefix P that denotes a fixed point subtype:
Yields the number of decimal digits needed after the
point to accommodate the precision of the subtype P,
unless the delta of the subtype P is greater than 0.1, in
which case the attribute yields the value one. (P'AFT is
the smallest positive integer N for which (10**N)*P'DELTA
is greater than or equal to one.) The value of this
attribute is of the type universal_integer. (See
3.5.10.)
P'BASE For a prefix P that denotes a type or subtype:
This attribute denotes the base type of P. It is only
allowed as the prefix of the name of another attribute:
for example, P'BASE'FIRST. (See 3.3.3.)
P'CALLABLE For a prefix P that is appropriate for a task type:
Yields the value FALSE when the execution of the task P
is either completed or terminated, or when the task is
abnormal; yields the value TRUE otherwise. The value of
this attribute is of the predefined type BOOLEAN. (See
9.9.)
P'CONSTRAINED For a prefix P that denotes an object of a type with
discriminants:
A - 1
Yields the value TRUE if a discriminant constraint
applies to the object P, or if the object is a constant
(including a formal parameter or generic formal parameter
of mode in); yields the value FALSE otherwise. If P is
a generic formal parameter of mode in out, or if P is a
formal parameter of mode in out or out and the type mark
given in the corresponding parameter specification
denotes an unconstrained type with discriminants, then
the value of this attribute is obtained from that of the
corresponding actual parameter. The value of this
attribute is of the predefined type BOOLEAN. (See
3.7.4.)
A - 2
P'CONSTRAINED For a prefix P that denotes a private type or subtype:
Yields the value FALSE if P denotes an unconstrained
nonformal private type with discriminants; also yields
the value FALSE if P denotes a generic formal private
type and the associated actual subtype is either an
unconstrained type with discriminants or an unconstrained
array type; yields the value TRUE otherwise. The value
of this attribute is of the predefined type BOOLEAN.
(See 7.4.2.)
1
P'COUNT For a prefix P that denotes an entry of a task unit:
Yields the number of entry calls presently queued on the
entry (if the attribute is evaluated within an accept
statement for the entry P, the count does not include the
calling task). The value of this attribute is of the
type universal_integer. (See 9.9.)
P'DELTA For a prefix P that denotes a fixed point subtype:
Yields the value of the delta specified in the fixed
accuracy definition for the subtype P. The value of this
attribute is of the type universal_real. (See 3.5.10.)
P'DIGITS For a prefix P that denotes a floating point subtype:
Yields the number of decimal digits in the decimal
mantissa of model numbers of the subtype P. (This
attribute yields the number D of section 3.5.7.) The
value of this attribute is of the type universal_integer.
(See 3.5.8.)
P'EMAX For a prefix P that denotes a floating point subtype:
Yields the largest exponent value in the binary canonical
form of model numbers of the subtype P. (This attribute
yields the product 4*B of section 3.5.7.) The value of
this attribute is of the type universal_integer. (See
3.5.8.)
P'EPSILON For a prefix P that denotes a floating point subtype:
Yields the absolute value of the difference between the
model number 1.0 and the next model number above, for the
subtype P. The value of this attribute is of the type
universal_real. (See 3.5.8.)
P'FIRST For a prefix P that denotes a scalar type, or a subtype
of a scalar type:
Yields the lower bound of P. The value of this attribute
has the same type as P. (See 3.5.)
A - 3
P'FIRST For a prefix P that is appropriate for an array type, or
that denotes a constrained array subtype:
Yields the lower bound of the first index range. The
value of this attribute has the same type as this lower
bound. (See 3.6.2 and 3.8.2.)
A - 4
P'FIRST(N) For a prefix P that is appropriate for an array type, or
that denotes a constrained array subtype:
Yields the lower bound of the N-th index range. The
value of this attribute has the same type as this lower
bound. The argument N must be a static expression of
type universal_integer. The value of N must be positive
(nonzero) and no greater than the dimensionality of the
array. (See 3.6.2 and 3.8.2.)
P'FIRST_BIT